import request from '@/utils/request'

// 查询花列表
export function listflower(query) {
  return request({
    url: '/flower/list',
    method: 'get',
    params: query
  })
}

// 查询花分类
export function typeFlower(query) {
    return request({
      url: '/flower/type',
      headers: {
        isToken: false
      },
      method: 'get',
      params: query
    })
}

export function delFlower(id) {
    return request({
        url: '/flower/id/' + id,
        method: 'delete'
    })
}
export function delFlorist(id) {
    return request({
        url: '/flower/florist/' + id,
        method: 'delete'
    })
}

export function uploadImg(img) {
    const formData = new FormData()
    formData.append('img', img)
    return request({
      url: '/image/upload',
      headers: { 'Content-Type': 'multipart/form-data' },
      method: 'post',
      data: formData
    })
  }

  export function addFlower(data) {
    return request({
      url: '/flower/add',
      method: 'post',
      data: data
    })
  }
  
  export function listFlorist(query) {
    return request({
      url: '/flower/florist',
      headers: {
        isToken: false
      },
      method: 'get',
      params: query
    })
  }
  export function addFlorist(data) {
    return request({
      url: '/flower/florist/add',
      method: 'post',
      data: data
    })
  } 
  export function addFlorists(data) {
    return request({
      url: '/flower/florists/add',
      method: 'post',
      data: data
    })
  }
  export function delFlorists(id) {
    return request({
        url: '/flower/florists/' + id,
        method: 'delete'
    })
}
  
  
